<?php

use Illuminate\Routing\Router;
use Illuminate\Support\Facades\Route;
use Dcat\Admin\Admin;

Admin::routes();

Route::group([
    'prefix' => config('admin.route.prefix'),
    'namespace' => config('admin.route.namespace'),
    'middleware' => config('admin.route.middleware'),
], function (Router $router) {

    $router->get('/', 'HomeController@index');

    $router->get('/auth/settings', 'SettingsController@index');
    $router->get('/user_management', 'ManagementController@grid');
    $router->get('/user_management/create', 'ManagementController@addForm');
    $router->post('/user_management', 'ManagementController@store');
    $router->get('/user_management/{id}', 'ManagementController@detail');
    $router->get('/user_management/{id}/edit', 'ManagementController@editForm');
    $router->put('/user_management/{id}', 'ManagementController@edit');
    $router->delete('/user_management/{id}', 'ManagementController@delete');

//    自定义页面
    $router->get('/customizing_pages', 'CustomizingPagesController@index');

//    设置语言
    $router->post('/setLanguage', 'SwitchingLanguageController@switch');

//    客户对接
    $router->get('/customer_docking', 'CustomerDockingController@index');
    $router->get('/chat_content', 'CustomerDockingController@getData');
    $router->put('/work_order/{id}', 'CustomerDockingController@workOrderEdit');
    $router->put('/users_management/{id}', 'CustomerDockingController@usersManagementEdit');
});
